<template>
    <div>
        <ul v-for="(item,index) in song" :key="index">
            <route-link to="'/songlistdetail/'+item.id">
                <li>
                    {{item.name}}--{{item.ar[0].name}}-{{item.al.name}}
                 </li>
            </route-link>
            
        </ul>
    </div>
</template>
<script>
import axios from 'axios'
export default {
    name:'detail',
    data(){
        return{
            // details: [],
            song:[]
        }
    },
    methods:{
        // 歌单详情
        getdetails(id){
            axios({
                method:'get',
                url:'http://localhost:5000/song/url?id='+id
            }).then((res)=>{
                console.log(res);
                // this.details = res.data.playlist;
                this.song = res.data.playlist.tracks;
            })
        }
    },
    mounted(){
        //  this.getsongurl(id);
        this.getdetails(this.$route.params.id);
    }
}
</script>